package org.jash.exam

import androidx.lifecycle.MutableLiveData
import com.example.lib_base.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import org.jash.exam.entity.ExamEntity
import javax.inject.Inject

@HiltViewModel
class ExamViewModel @Inject constructor(private val repo: ExamRepo):BaseViewModel (){
    val ExamListSuccess = MutableLiveData<MutableList<ExamEntity>>()
    fun examlist(userid:Int){
        httpRequest({ repo.apiService.getExamList(userid) },{ExamListSuccess.value = it})
    }
    val checkInSuccess = MutableLiveData<ExamEntity>()
    fun checkIn(map: Map<String,Any>){
        httpRequest({ repo.apiService.checkIn(repo.mapTopBody(map)) },{checkInSuccess.value = it})
    }
}